package com.teapos.enumtype;

/**
 * 商品类型枚举
 * @author kangrui
 *
 */
public enum ProductTypeEnum {
	
	INTEGRATED(1, "整装"),
	SCATTERED(2, "散装");
	
	private int code;
	private String desc;
	private ProductTypeEnum(int code, String desc) {
		this.code = code;
		this.desc = desc;
	}
	public int getCode() {
		return code;
	}
	public void setCode(int code) {
		this.code = code;
	}
	public String getDesc() {
		return desc;
	}
	public void setDesc(String desc) {
		this.desc = desc;
	}
	
	public static ProductTypeEnum getEnumByCode(int code) {
		ProductTypeEnum[] enums = ProductTypeEnum.values();
		for(ProductTypeEnum enumtype:enums) {
			if(enumtype.getCode()==code) return enumtype;
		}
		return null;
	}

}
